package pojo;

import java.util.List;

public class PageData <T>{

    private List<T> dataList;//当前的数据

    private long totalCount;//总条数

    private long totoalPage;//总页数

    private int pageSize;//每页的数量

    private int pageNum;//当前第几页

    public List<T> getDataList() {
        return dataList;
    }

    public void setDataList(List<T> dataList) {
        this.dataList = dataList;
    }

    public long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }

    public long getTotoalPage() {
        return (totalCount+pageSize-1)/pageSize;
    }

    public void setTotoalPage(long totoalPage) {
        this.totoalPage = totoalPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    @Override
    public String toString() {
        return "PageData{" +
                "dataList=" + dataList +
                ", totalCount=" + totalCount +
                ", totoalPage=" + totoalPage +
                ", pageSize=" + pageSize +
                ", pageNum=" + pageNum +
                '}';
    }
}
